<?php
 defined('RUN')or die('No access');class Url{public static function base(){$a=isset($_SERVER['HTTPS'])&&strtolower($_SERVER['HTTPS'])!=='off'?'https':'http';$a.='://'.$_SERVER['HTTP_HOST'];$a.=str_replace(basename($_SERVER['SCRIPT_NAME']),'',$_SERVER['SCRIPT_NAME']);return rtrim($a,'/');}public static function current(){$b='http'.(empty($_SERVER['HTTPS'])?'':'s').'://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];return $b;}public static function anchor($c=NULL){if($c==NULL)$c=Config::get('default_controller');$d=self::base();$d=$d.'/'.(Config::get('multi_languages')?Language::getLanguageCode().'/':'');$d=$d.$c.Config::get('url_suffix');return $d;}public static function redirect($c=null){Session::transferFlash();if(strpos($c,'http')===FALSE){$c=self::anchor($c);}header('Location: '.$c);die();}}